Gavi and Lamine Yamal score either side of half time to give Hansi Flick a shot at his first trophy as Barça coach.